package cn.edu.buaa.cnsatm.traffic_big_data_server.highway.model;

import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class HighwayCongestPointModel {
    BigDecimal congestValue;
    String lon, la;
    BigDecimal radius;

    public HighwayCongestPointModel(BigDecimal congestValue, String lon, String la, BigDecimal radius) {
        this.congestValue = congestValue.divide(new BigDecimal("1"), 2, RoundingMode.HALF_UP);
        this.lon = lon;
        this.la = la;
        this.radius = radius;
    }

    public BigDecimal getCongestValue() {
        return congestValue;
    }

    public void setCongestValue(BigDecimal congestValue) {
        this.congestValue = congestValue;
    }



    public void setLon(String lon) {
        this.lon = lon;
    }

    public String getLa() {
        return la;
    }

    public void setLa(String la) {
        this.la = la;
    }

    public BigDecimal getRadius() {
        return radius;
    }

    public void setRadius(BigDecimal radius) {
        this.radius = radius;
    }

    @Override
    public String toString() {
        return "HighwayCongestPointModel{" +
                "congestValue=" + congestValue +
                ", lon='" + lon + '\'' +
                ", la='" + la + '\'' +
                ", radius=" + radius +
                '}';
    }
    public JsonObject toJsonObject(){
        JsonObject jo = new JsonObject();
        jo.addProperty("lon", this.lon);
        jo.addProperty("la", this.la);
        jo.addProperty("congest_value", this.congestValue);
        jo.addProperty("radius", this.radius);
        return jo;
    }
}
